﻿#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;

class BaseOne
{
public:
	BaseOne()
	{
		m_A = 10;
	}

public:
	int m_A;
};
class BaseTwo
{
public:
	BaseTwo()
	{
		m_B = 20;
		m_A = 30;
	}

public:
	int m_B;
	int m_A;
};
//1.多继承；
class SonMany :public BaseOne, public BaseTwo
{
public:
	int m_C;
	int m_D;
};
//2.多继承中很容易引发二义性；
void testManyExtends()
{
	cout << sizeof(SonMany) << endl;//16 --> 20

	SonMany son;
	//3.二义性；
	//cout << son.m_A << endl;//10
	cout << son.BaseOne::m_A << endl;//10
	cout << son.BaseTwo::m_A << endl;//10 --> 30
}

//main291：多继承的概念以及问题
int main291()
{
	testManyExtends();
	system("pause");
	return EXIT_SUCCESS;
}